//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package objects;

import common.GlobalID;

import java.util.LinkedHashMap;

public class AnimalEntry {
    private final String Name;
    private final Integer UnlockLevel;
    private final Integer Instance;
    private final String Feed;
    private final String Good;
    private final LinkedHashMap<Integer, ProductionsGoodEntry> goodsById = new LinkedHashMap();
    private final LinkedHashMap<String, ProductionsGoodEntry> goodsByName = new LinkedHashMap();

    public AnimalEntry(String Name, Integer UnlockLevel, Integer Instance, String Feed, String Good) {
        this.Name = Name;
        this.UnlockLevel = UnlockLevel;
        this.Instance = Instance;
        this.Feed = Feed;
        this.Good = Good;
    }

    public String getName() {
        return this.Name;
    }

    public Integer getUnlockLevel() {
        return this.UnlockLevel;
    }

    public Integer getGlobalID() {
        return Integer.valueOf(GlobalID.create(13, this.Instance.intValue()));
    }

    public String getFeed() {
        return this.Feed;
    }

    public String getGood() {
        return this.Good;
    }

    public Integer getInstance() {
        return this.Instance;
    }

    public void addGoodEntryWithObjectClass(ProductionsGoodEntry sge, int objectClass, int instance) {
        if(sge.getName() != null) {
            sge.setInstance(instance);
            this.goodsByName.put(sge.getName(), sge);
            this.goodsById.put(sge.getGlobalID(Integer.valueOf(objectClass)), sge);
        }

    }

    public ProductionsGoodEntry getGoodById(Integer id) {
        return (ProductionsGoodEntry)this.goodsById.get(id);
    }

    public ProductionsGoodEntry getGoodByName(String name) {
        return (ProductionsGoodEntry)this.goodsByName.get(name);
    }

    public String toString() {
        return this.Name + "(" + this.getGlobalID() + "): UnlockLevel:" + this.UnlockLevel + ", Feed:" + this.Feed + ", Good:" + this.Good;
    }
}
